// The following ifdef block is the standard way of creating macros which make exporting 
// from a DLL simpler. All files within this DLL are compiled with the CAP_KEY_EXPORTS
// symbol defined on the command line. This symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see 
// CAP_KEY_API functions as being imported from a DLL, whereas this DLL sees symbols
// defined with this macro as being exported.
#ifdef CAP_KEY_EXPORTS
#define CAP_KEY_API __declspec(dllexport)
#else
#define CAP_KEY_API __declspec(dllimport)
#endif

// This class is exported from the cap_key.dll
class CAP_KEY_API KeyHook
{
protected:
	friend LRESULT CALLBACK CallBack(int,WPARAM, LPARAM);
	HINSTANCE _hInst;
	HHOOK _lastHook;
	LRESULT DoOnEvent(int,WPARAM, LPARAM);
public:
	KeyHook();
	~KeyHook();
	void Install(int hkid = WH_KEYBOARD);
	void Uninstall();
	virtual void OnEvent(int,WPARAM, LPARAM){}
};